# To change this template, choose Tools | Templates
# and open the template in the editor.

require 'matrix'

class Matrix
 def print
  for i in (0...self.row_size)
   strg = ""
   for j in (0...self.column_size)
    strg = strg + " " + (self.[](i,j)).to_s
   end
   puts strg
  end
 end

end

class InspectFile
 attr_reader  :n, :mat, :tab

  def initialize
    @n = 0
  end

  def parse(file)
    i = 0
    j = 0
    while line = file.gets
      if i == 0
        @n = line.chop
        @tab = Array.new(@n.to_f)
      else
        @tab[j] = Array.new
        line.split(' ').each { |a| @tab[j].push(a.chomp.to_f)}
        j += 1
      end
      i += 1  
    end
    @mat = Matrix.rows(@tab)
  end

end
